package pers.vic.mq.kafka.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;
/**
 *  定义KAFKA发送的数据的格式
 * @author VIC
 *
 */
public class EventMsg implements Serializable {
	
    private static final long serialVersionUID = 1L;
    /**
     * 一般情况下应该是主题名
     */
    private String method;
    
    /**
     * 发送的数据
     */
    private Object data;

    public EventMsg(){}
    
    
    public EventMsg(String method, Object data) {
		super();
		this.method = method;
		this.data = data;
	}



	public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
